﻿using System;
using NLog;

namespace TimerTask.Common.Utils
{
    public class LogUtil
    {
        public static void Error(Exception ex, string fmt, string loggerName = "main", params object[] args)
        {
            LogManager.GetLogger(loggerName).Error(ex, fmt, args);
        }

        public static void Error(Exception ex, string msg, string loggerName = "main")
        {
            LogManager.GetLogger(loggerName).Error(ex, msg, null);
        }

        public static void Error(string msg, string loggerName = "main")
        {
            LogManager.GetLogger(loggerName).Error(msg);
        }

        public static void Error(string fmt, string loggerName = "main", params object[] args)
        {
            LogManager.GetLogger(loggerName).Error(fmt, args);
        }

        public static void Info(string msg, string loggerName = "main")
        {
            LogManager.GetLogger(loggerName).Info(msg);
        }

        public static void Info(string fmt, string loggerName, params object[] args)
        {
            LogManager.GetLogger(loggerName).Info(fmt, args);
        }
    }
}
